#include"reactor.hpp"
#include"listener.hpp"
//  启动方式:  ./server 端口号 
//  比如:      ./server 8888
int main(int argc,char* argv[]){
    if(argc<2){
        LOG(ERROR)<<"USAGE: ./server port";
        return USAGE_ERR;
    }
    uint16_t port=std::stoi(argv[1]);

    std::unique_ptr<reactor> r=std::make_unique<reactor>();
    r->Init();

    connect_t listensock=make_Listener(port);
    r->insert(listensock);
    r->Loop();
    r->stop();
    return 0;
}